package totoCharts;

/*
 * this servlet is the only servlet in this project to use doPost function
 * it is desigend to recieve the form representation from the gadget
 * and store it as an "old form" in the appengine DB (along with the WAVEID and
 * Date) for future use
 */

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class totoOldFormStorage extends HttpServlet {
		
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	  {
	    String oldFormString,date;
	    int waveID;
	    oldFormString=request.getParameter("lorem"); //the form's representation
	    waveID=Integer.parseInt(request.getParameter("ID")); //the waveID
	    date=request.getParameter("date");//the form's fillout date
	    
	    //creating the object and saving in the DB
	    oldForm old=new oldForm(waveID,oldFormString,date);
	    guestbook.DBMethods.saveInDB(old, true);   	
	  }
	    
}
